package com.qf.search.entity;

import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.*;

/**
 * author Ken
 * create_time 2022/11/30
 */
@Data
@Accessors(chain = true)
@Document(indexName = "hotel_index", shards = 1, replicas = 0)
public class Hotel {
    @Id
    private Integer id;

    @MultiField(
            mainField = @Field(type = FieldType.Text, analyzer = "ik_max_word"),
            otherFields = {
                    @InnerField(suffix = "py", type = FieldType.Text, analyzer = "pinyin"),
                    @InnerField(suffix = "kw", type = FieldType.Keyword)
            }
    )
    private String title;
    @Field(type = FieldType.Double)
    private Double price;
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String info;
}
